<?php 

$responce['page'] = $pager->getPage();
$responce['total'] = $pager->getLastPage();
$responce['records'] = $pager->count();
$i=0;
foreach($pager->getResults() as $result)
{
    $responce['rows'][$i]['id'] = $result->getId();
    $responce['rows'][$i]['cell'] = array($result->getId(),$result->getSite(), $result->getUrl());
    $i++;
}
echo json_encode($responce);
?>
